<template>
  <div class="pagecontent">
    <div class="commonheader border">
      <i class="iconback"
         @click="backClick"></i>
      <h3>精准估价</h3>
    </div>
    <div class="btn"
         @click="btnClick">下一步</div>
    <div class="infobox">
      <div class="infobar"><em>包款选择</em>{{this.$store.state.goodsTitle}}</div>
      <!--goodsName||this.$route.query.itemName-->
    </div>
    <div class="goodsnumber">
      <h3>包内编码</h3>
      <input type="text"
             placeholder="请输入包内编码，无编码请直接下一步"
             v-model="goodsCode" />
    </div>
  </div>
</template>

<script>
import Bus from '../../../static/js/bus'
export default {
  name: 'goodsDetail',
  data () {
    return {
      goodsName: '',
      goodsCode: ''
    }
  },
  created () {
    Bus.$on('senddetaildata', (data) => {
      this.goodsName = data.name
    })
    console.log(this.$route.query.itemName)
  },
  methods: {
    btnClick () {
      this.$router.push({
        path: '/preciseValuation',
        query: { sendName: this.goodsName, goodsCode: this.goodsCode }
      })
    },
    backClick () {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="stylus" scoped>
.infobox
  padding 0.1rem 0 0.1rem 0.3rem
  position relative
  &:before
    content ''
    width 0.04rem
    height 0.22rem
    background #d21733
    position absolute
    left 0
    top 0.26rem
  .infobar
    font-size 0.3rem
    color #333
    padding 0.11rem 0
    em
      color #999
      display inline-block
      width 1.5rem
.goodsnumber
  h3
    padding 0.3rem
    font-size 0.32rem
    color #333
    position relative
    &:before
      content ''
      width 0.04rem
      height 0.22rem
      background #d21733
      position absolute
      left 0
      top 0.36rem
  input
    border-radius 0.5rem
    background #fafafa
    font-size 0.24rem
    display block
    width 6.85rem
    height 0.56rem
    line-height 0.56rem
    text-align center
    margin 0 auto
.btn
  position fixed
  height 1rem
  line-height 1rem
  left 0
  right 0
  bottom 0
  background #d21733
  font-size 0.32rem
  color #fff
  text-align center
  z-index 10
</style>
